#{extends 'mainStage.html' /}
#{set title:'Liste des stages terminés'/}
#{if stages}
    <div class="post">
        <div class="post">
            <h2 class="post-title">
                Liste des stages
            </h2>
            <br>
            <table cellpadding="0" cellspacing="0" border="0" class="display" id="liste"> 
        		<thead>
        			<tr>
        				<th>&Eacute;tat</th>
        				<th>Intitule</th>	
        				<th>Code</th>
        				<th>Structure Organisatrice</th>
        				<th>Dur&eacute;e</th>
        				<th>Lieu</th>
        				<th>Date de D&eacute;but</th>
        				<th>Condition de d&eacute;roulement</th>
						<th>Effectif</th>
						<th>Action sur le stage</th>
						
        			</tr>
        		</thead>		

                <tbody>
        	    #{list items:stages, as:'stage' } 
        	       <tr>
        	       		<td>
        	       			${stage.etat}
        	       		</td>
        	            <td> 
                            <a href="@{Stages.detailStage(stage.id)}">${stage.intitule}</a>
        	            </td>
        	            
        	            <td> 
                            ${stage.code}
        	            </td>
        	            
        	            <td> 
                            ${stage.structure}
        	            </td>
        	            
        	            <td> 
                            ${stage.duree}
        	            </td>
        	            
        	                <td> 
                            #{if stage.cis == null}
                                -
        	                #{/if}
                            #{else}
        	                    ${stage.cis}
                            #{/else}
        	            </td>
        	            
        	            <td> 
                            #{if stage.dateDeb == null}
                                -
        	                #{/if}
                            #{else}
        	                    ${stage.dateDeb.format('dd MMMM yyyy', 'fr')}
                            #{/else}
        	            </td>
        	            
        	            <td> 
                            #{if stage.modalites == null}
                                -
        	                #{/if}
                            #{else}
        	                    ${stage.modalites}
                            #{/else}
        	            </td>
        	            
        	            <td> 
                            #{if stage.getEffectif() == null}
                                -
        	                #{/if}
                            #{else}
                            #{if !(stage.effectifMax == null)}
        	                    ${stage.effectifMax-stage.getEffectif()}
        	                #{/if}
                            #{/else}
        	            </td>
        	            
        	            <td>
							<a href="@{Candidats.entrerResultat(stage.id)}">Entrer les r&eacute;sultats</a><br/><a href="@{Stages.ajouterDatesAdministratives(stage.id)}">Ajouter les dates de bilan</a>
						</td>	
        	            
        	       </tr>
        	       
        	       
        	    #{/list}
        	    </tbody>
        	</table>
        </div>
    </div>    
#{/if}
 
#{else}
    <div class="empty">
        Pas de stage.
    </div>
#{/else}
